<h2>DESCRIPTION</h2>

Converts one 3D raster map into several 2D raster maps (depends on depths). 
If the 2D and 3D region settings are different, the 3D resolution will be 
adjusted to the 2D resolution (the depths are not touched).
The user can force <em>r3.to.rast</em> to use the 2D resolution of the input 
3D raster map for the output maps, independently from the current region settings.

<center>
<img src="r3.to.rast.png" border="0"><br>
<table border="0" width="700">
<tr><td><center>
<em>How r3.to.rast works</em>
</center></td></tr>
</table>
</center>

<h3>Map type conversions</h3>

Type of resulting 2D raster maps is determined by the type of the
input 3D raster, i.e. 3D raster of type DCELL (double) will result in
DCELL 2D rasters. A specific type for 2D rasters can be requested using
the <b>type</b> option.

<p>
The <b>type</b> option is especially advantageous when the 3D raster
map stores categories (which need to be stored as floating point numbers)
and the 2D raster map should be also categorical, i.e. use integers.
The type is set to <tt>CELL</tt> in this case. 


<h3>Modifying the values</h3>

The values in the 3D raster map can be modified prior to storing in
the 2D raster map. The values can be scaled using the option <b>multiply</b>
and a constant value can be added using the option <b>add</b>.
The new value is computed using the following equation:

<pre>
y = ax + b
</pre>

where <em>x</em> is the original value, <em>a</em> is the value of
<b>multiply</b> option, <em>b</em> is the value of <b>add</b> option,
and <em>y</em> is the new value. When <b>multiply</b> is not provided,
the value of <em>a</em> is 1. When <b>add</b> is not provided, the value
of <em>b</em> is 0.


<h2>NOTES</h2>

Every slice of the 3D raster map is copied to one 2D raster map. The maps
are named like <b>output</b><em>_slicenumber</em>. Slices are counted from bottom
to the top, so the bottom slice has number 1. 

<p>
The number of slices is equal to the number of depths.

<p>
To round floating point values to integers when using <tt>type=CELL</tt>,
the <b>add</b> option should be set to 0.5.

<h2>SEE ALSO</h2>

<em>
<a href="r3.cross.rast.html">r3.cross.rast</a>,
<a href="r3.out.vtk.html">r3.out.vtk</a>,
<a href="r3.out.ascii.html">r3.out.ascii</a>,
<a href="g.region.html">g.region</a>
</em>

<h2>AUTHOR</h2>
S&ouml;ren Gebbert
Vaclav Petras, <a href="http://geospatial.ncsu.edu/osgeorel/">NCSU GeoForAll Lab</a>

<!--
<p>
<i>Last changed: $Date$</i>
-->
